{% extends "djforum/base.html" %}

{% load i18n staticfiles pagination_tags forum_tags %}

{% block title %}{{ forum }} | {{ block.super }}{% endblock %}

{% block content %}
    <aside class="widget forum">

        <ul class="breadcrumb">
            <li><a class="title" href="{{ forum.category.get_absolute_url }}">{{ forum.category }}</a> <span class="divider">/</span></li>
            <li class="active">{{ forum }}</li>
        </ul>

        <div class="pull-right topic-toolbar">
            {% if user.is_authenticated %}
                {% with unread_count=user|unread_topics_count %}
                <a href="{% url 'forum:unread_topics' %}" class="btn btn-small">
                    {% trans "Unread topics" %}{% if unread_count %} ({{ unread_count }}){% endif %}
                </a>
                {% endwith %}
            {% endif %}

            <a href="{% url 'forum:add_topic' forum.pk %}" class="btn btn-small">{% trans "New topic" %}</a>

            {% if user.is_authenticated %}
            <a href="{% url 'forum:mark_read_forum' forum.pk %}" class="btn btn-small">{% trans "Mark all as read" %}</a>
            {% endif %}

            {% if not forum.category.groups.exists %}
            <a href="{% url 'forum:feed_latest_forum_entries' forum.pk %}" class="btn btn-small" style="margin-right: 1px">{% trans "RSS" %}</a>
            {% endif %}
        </div>

        {% if is_paginated %}
            {% paginate float='left' %}
        {% endif %}

        {% include 'djforum/_topic_list.html' with show_info="no" %}

        {% if is_paginated %}
            {% paginate float='left' %}
        {% endif %}
    </aside>
{% endblock %}
